package com.relational.mapping.Service.Impl;

import com.relational.mapping.Model.Role;
import com.relational.mapping.Repository.RoleRepository;
import com.relational.mapping.Service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Csea
 * @title
 * @date 2019/6/10 15:52
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleRepository repository;

    @Override
    public Role save(Role role) {
        return repository.save(role);
    }

    @Override
    public Role findById(Integer roleId) {
        return repository.findById(roleId).orElse(null);
    }

    @Override
    public void deleteId(Integer roleId) {
        repository.deleteById(roleId);
    }
}
